﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>微物购</title>
    <link rel="stylesheet" type="text/css" href="css/base.css" />
    <link rel="stylesheet" type="text/css" href="css/home.css" />
    <link rel="stylesheet" type="text/css" href="city/city.css">
    <link rel="stylesheet" type="text/css" href="css/contact.css">
    <link rel="stylesheet" type="text/css" href="css/swiper-bundle.min.css">

    <link rel=" icon" href="http://wb.boqibao.com/favicon2.ico">
    <script type="text/javascript" src="script/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="script/home_ban.js"></script>
    <script type="text/javascript" src="script/eg_top_search.js"></script>
    <script type="text/javascript" src="script/city.js"></script>
    <script type="text/javascript" src="script/snncar.js"></script>
    <script type="text/javascript" src="script/jquery.SuperSlide.2.1.1.js"></script>
    <!--引入vue和Axios.js 先导入vue  再导入axios -->
    <script src="plugins/vue/dist/vue.js"></script>
    <script src="plugins/axios/dist/axios.js"></script>
    <script src="script/main.js"></script>



</head>

<body>
    <div id="index">
        <div class="egc-top">
            <div class="nav-cent">
                <div class="top-r">
                    <span>
                        <a href="" class="top-l" id="myBtn1" @click="recharge">充值联系方式</a>|
                    </span>
                    <!--                <span>-->
                    <!--                    <a href="contactCustomer.html" class="top-l" id="myBtn" @click="">联系客服</a>|-->
                    <!--                </span>-->
                    <span id="loginBefore">
                        <!--                    <a href="javascript:void(0)" id="b-regist">注册</a>|-->
                        <a href="#" id="b-regist">注册联系方式</a>|
                        <a href="#" id="b-login" class="b-login">登陆</a>
                        <!--                    <a href="https://open.weixin.qq.com/connect/qrconnect?appid=wx03bd86056bd3fc0e&redirect_uri=http://wx.rongcarservice.com/callback.html&response_type=code&scope=snsapi_login&state=1#wechat_redirect"-->
                        <!--                       target="_blank" id="b-wx-login">微信登录</a>-->
                        |
                        <!--                    <a href="#" class="b-login" id="b-phoneLogin">手机验证码登录</a>-->
                        <!--                    |-->
                        <!--                    <a href="#" class="b-login" id="b-retrievepassword">找回密码</a>-->
                    </span>
                    <span id="loginAfter" style="display: none;">
                        欢迎您：{{username}}！| 余额:{{this.user.balance}} |
                        <a href="#" id="b-logout" @click="loginOut">登出</a>
                    </span>
                </div>
                <!--            <div class="top-l">联系客服</div>-->
                <div class="clear_fix"></div>
            </div>
        </div>

        <div class="navigation">
            <div class="nav-cent">
                <div class="logo"><a href="index.html"><img src="images/logo.png.jpg"
                            style="width: 145px; height: 90px" /></a></div>
                <div class="city"><span id="DY_site_name" class="red city-name Left"></span>
                    <div id="JS_hide_city_menu_11" class="city-select cut_handdler Left">
                        <!--                    <a href="javascript:void(0);" class="common-bg selector"></a>-->
                        <div id="JS_header_city_bar_box" class="hide_city_group">
                            <div class="hideMap">
                                <div class="showPanel clearfix">
                                    <div class="Left mycity">
                                        <div id="JS_current_city_box"><strong id="JS_city_current_city"></strong>
                                        </div>
                                        <div id="JS_default_city_delete" style="display: none;"></div>
                                    </div>
                                </div>
                                <div class="showPanel showPanel2 clearfix">
                                    <div class="hot_city" id="JS_header_city_hot"></div>
                                    <div class="city_words mt10" id="JS_header_city_char"></div>
                                </div>
                                <div class="scrollBody">
                                    <div class="cityMap clearfix">
                                        <table id="JS_header_city_list" class="city_list" style="margin-top: 0px;">
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="scrollBar"><span id="JS_header_city_bar"
                                            style="margin-top: 0px;"></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <span class="common-bg city-logo"></span>
                </div>
                <!--            <div class="sea">-->
                <!--                <div class="egc-sea-box">-->
                <!--                    <input type="text" class="sea-ipt-txt" placeholder="搜索您想要的商品"/>-->
                <!--                    <a href="#" class="search-btn">搜索</a></div>-->
                <!--            </div>-->
                <!-- <div class="hot-phone"> <i></i> <span class="js-change-phone">免费发布信息</span> </div> -->

            </div>
        </div>

        <ul class="navmenu">
            <li class="active"><a href="index.html">首页</a><span></span></li>
            <li><a href="goods.html">商品列表</a><span></span></li>
            <li><a href="order.html">订单中心</a><span></span></li>
            <!--        <li><a href="user.html">个人中心</a><span></span></li>-->
        </ul>

        <div class="clear_fix"></div>

        <div class="banner">
            <!--左侧买卖车-->
            <div class="mainmenu">
                <div class="sel-area">
                    <div class="buy-tit">全部分类</div>
                    <div class="all-sort-list">
                        <div class="item">
                            <h3>
                                <div class="border"><a href="">微博</a></div>
                                <ul>
                                    <li><a href="goods.html?type=1">关注</a></li>
                                    <li><a href="goods.html?type=2">转发</a></li>
                                    <li><a href="goods.html?type=3">评论</a></li>
                                    <li><a href="goods.html?type=4">点赞</a></li>
                                    <li><a href="goods.html?type=5">阅读</a></li>
                                    <li><a href="goods.html?type=6">视频播放</a></li>
                                    <li><a href="goods.html?type=7">真人转评赞</a></li>
                                    <li><a href="goods.html?type=8">统一转评赞</a></li>
                                    <li><a href="goods.html?type=9">评中评</a></li>
                                    <li><a href="goods.html?type=10">评论赞</a></li>
                                </ul>
                            </h3>

                        </div>

                    </div>

                    <div class="clear_fix"></div>

                </div>
            </div>
            <div class="menu_right">
                <!-- <div class="swiper mySwiper">
                    <div class="swiper-wrapper">
                        <div class="swiper-slide">Slide 1</div>
                        <div class="swiper-slide">Slide 2</div>
                        <div class="swiper-slide">Slide 3</div>
                        <div class="swiper-slide">Slide 4</div>
                        <div class="swiper-slide">Slide 5</div>
                        <div class="swiper-slide">Slide 6</div>
                        <div class="swiper-slide">Slide 7</div>
                        <div class="swiper-slide">Slide 8</div>
                        <div class="swiper-slide">Slide 9</div>
                    </div>
                    <div class="swiper-button-next"></div>
                    <div class="swiper-button-prev"></div>
                    <div class="swiper-pagination"></div>
                </div> -->
                <div class="flexslider">
                    <ul class="slides slide" id="lunbo">
                        <li>
                            <img src=" http://webshopdonw.com/pic/333.png" alt="" style="height: 100%;width: 100%;">
                        </li>
                        <li>
                            <img src=" http://webshopdonw.com/pic/333.png" alt="" style="height: 100%;width: 100%;">
                        </li>
                    </ul>

                </div>
                <div class="clear_fix"></div>

            </div>
        </div>




        <!--会员登录和注册弹出框开始-->
        <div id="popBox">

            <div class="popCont">
                <div class="p-tab-box">
                    <a class="p_closed">关闭</a>
                    <div class="p-tab">
                        <a class="login">会员登录<i></i></a>
                        <a class="regist">联系客服<i></i></a>
                        <!--                <a class="phonelogin">手机验证码登录<i></i></a>-->
                        <!--                <a class="retrievepassword">找回密码<i></i></a>-->
                    </div>
                </div>

                <div class="p-detail">

                    <div class="p-dl login">
                        <form name="form" id="form">
                            <ul class="login-items">
                                <li>
                                    <label>用户名</label>
                                    <input class="input" type="text" value="" maxlength="32" name="username"
                                        v-model="loginDto.username" placeholder="请输入用户名(账号/手机号/邮箱)">
                                </li>
                                <li>
                                    <label>密码</label>
                                    <input class="input" type="password" value="" maxlength="16" name="password"
                                        v-model="loginDto.password" placeholder="请输入密码">
                                </li>
                            </ul>
                            <div class="login-check">
                                <input type="checkbox" name="checkbox" style=" width:auto;" />
                                <label>记住我</label>
                                <a href="Meet/editPass">忘记登录密码？</a>
                            </div>
                            <div class="login-button">
                                <input type="hidden" value="" name="carid" class="ordercarid" />
                                <input type="hidden" value="" name="carstatus" class="orderstatus" />
                                <input type="button" value="登陆" class="fM" @click="loginIn" />
                            </div>
                        </form>
                    </div>

                    <div class="p-dl regist">
                        <form class="registForm" onsubmit="return regcheck();" enctype="multipart/form-data"
                            method="post" name="reg" id="reg">
                            <ul class="login-items">
                                <li class="clearfix contact-box">
                                    <!--                                <input class="input" name="mobile" id="phone" :maxlength="11"-->
                                    <!--                                       v-model="RegisterDTO.phone" type="text" value=""-->
                                    <!--                                       placeholder="手机号">-->
                                    <span class="contact" style="color: red;">请联系QQ</span>
                                    <span class="contact" style="color: red;">3688032004</span>
                                    <span class="contact" style="color: red;">2717196271</span>
                                </li>
                                <!--                            <li class="clearfix">-->
                                <!--                                <input class="input left" type="text" v-model="RegisterDTO.imageCode" value=""-->
                                <!--                                       name="imgVerify" placeholder="image verification"-->
                                <!--                                       style="width:100px;margin-right: 10px;"/>-->
                                <!--                                <img :src="img" @click="getImg"/>-->
                                <!--                            </li>-->
                                <!--                            <li class="clearfix">-->
                                <!--                                <input class="input left" type="text" v-model="RegisterDTO.smsCode" value=""-->
                                <!--                                       name="verify" placeholder="verification code"-->
                                <!--                                       style="width:100px;"/>-->
                                <!--                                <div id="send"><a href="javascript:void(0)" @click="RegisterDTOCode($event)"-->
                                <!--                                                  class="send_code right">Get code</a></div>-->
                                <!--                            </li>-->
                                <!--                            <li class="clearfix">-->
                                <!--                                <input class="input" type="text" v-model="RegisterDTO.username" value="" name="realname"-->
                                <!--                                       placeholder="用户名">-->
                                <!--                            </li>-->
                                <!--                            <li class="clearfix">-->
                                <!--                                <input class="input" type="text" value="" v-model="RegisterDTO.email" name="email"-->
                                <!--                                       placeholder="邮箱">-->
                                <!--                            </li>-->
                                <!--                            <li class="clearfix">-->
                                <!--                                <input id="" class="input" type="password" v-model="RegisterDTO.password"-->
                                <!--                                       name="password" value=""-->
                                <!--                                       placeholder="密码">-->
                                <!--                            </li>-->
                                <!--                            <li class="clearfix">-->
                                <!--                                <input class="input" type="password" v-model="RegisterDTO.confirmPassword"-->
                                <!--                                       name="confirmPassword" value=""-->
                                <!--                                       placeholder="确认密码">-->
                                <!--                            </li>-->
                            </ul>
                            <div class="login-button">
                                <input type="hidden" value="" name="carid" class="ordercarid" />
                                <input type="hidden" value="" name="carstatus" class="orderstatus" />
                                <!--                            <input type="button" value="立即注册" class="fM" @click="registerSave"/>-->
                            </div>
                        </form>
                    </div>

                    <div class="p-dl phonelogin">
                        <form name="form">
                            <ul class="login-items">
                                <li>
                                    <label>Phone number</label>
                                    <input class="input" type="text" value="" maxlength="11" name="username"
                                        v-model="phoneLoginIn.phone" placeholder="输入手机号">
                                </li>
                                <li class="clearfix">
                                    <label>Verification code</label>
                                    <input class="input left" type="text" value="" name="verify"
                                        v-model="phoneLoginIn.smsCode" placeholder="验证码" style="width:100px;" />
                                    <div>
                                        <input type="button" style="width:100px" class="send_code right"
                                            @click="sendPhoneMessage($event)" value="获得验证码" />
                                    </div>
                                </li>
                            </ul>
                            <div class="login-button">
                                <input type="hidden" value="" name="carid" class="ordercarid" />
                                <input type="hidden" value="" name="carstatus" class="orderstatus" />
                                <input type="button" value="Log in" class="fM" @click="phoneLogin" />
                            </div>
                        </form>
                    </div>

                    <div class="p-dl retrievepassword">
                        <form name="form">
                            <ul class="login-items">
                                <li>
                                    <label>手机号</label>
                                    <input class="input" type="text" value="" maxlength="32" name="username"
                                        v-model="retrievePassword.phone" placeholder="请输入您的手机号">
                                </li>
                                <li class="clearfix">
                                    <label>验证码</label>
                                    <input class="input left" type="text" value="" name="verify" placeholder="输入验证码"
                                        v-model="retrievePassword.smsCode" style="width:100px;" />
                                    <div>
                                        <input type="button" style="width:100px" class="send_code right"
                                            @click="sendPhoneMessageChangePassword($event)" value="获取验证码" />
                                    </div>
                                </li>
                                <li>
                                    <label>密码</label>
                                    <input class="input" type="password" value="" maxlength="32" name="password"
                                        v-model="retrievePassword.password" placeholder="请输入密码">
                                </li>
                                <li>
                                    <label>确认密码</label>
                                    <input class="input" type="password" value="" maxlength="32" name="confirmpassword"
                                        v-model="retrievePassword.confirmPassword" placeholder="请再次输入密码">
                                </li>
                            </ul>
                            <div class="login-button">
                                <input type="hidden" value="" name="carid" class="ordercarid" />
                                <input type="hidden" value="" name="carstatus" class="orderstatus" />
                                <input type="button" value="提交" class="fM" @click="changePasswordCommit" />
                            </div>
                        </form>
                    </div>

                </div>
            </div>



            <div class="copyright">
                <div class="cent"> Copyright © 2023,All Rights Reserved</div>
            </div>
        </div>





    </div>



    <style>
        body {
            overflow: hidden;
        }

        .copyrights {
            text-indent: -9999px;
            height: 0;
            line-height: 0;
            font-size: 0;
            overflow: hidden;
        }

        .contact {
            font-size: 50px;
        }

        .flex-active-slide {
            background-size: 100% 100% !important;
            background-position: center !important;
        }

        @media (max-width: 767px) {
            .p-dl.regist {
                margin-left: 30px;
            }

            /* 在屏幕宽度小于768px时应用的样式 */
            @media (max-width: 767px) {
                #popBox {
                    width: 100%;
                    /* 设置弹出框宽度为屏幕宽度的90% */
                    /* margin: 0 auto; */
                    /* display: flex;
                    justify-content: center; */
                    /* 垂直居中 */
                }

                .contact {
                    font-size: 18px;
                }

                .contact-box {
                    display: flex;
                    /* justify-content: ; */
                    flex-direction: column;
                }

                .flex-active-slide {
                    background-size: 100% 100% !important;
                    background-position: center center !important;
                    /* background-attachment: fixed !important; */
                    /* 背景图片固定 */

                }

                .p-tab-box {
                    width: 100%;
                    display: flex;
                    flex-direction: row-reverse;
                    border-bottom: 6px solid #0268b5;

                }

                .p-tab {
                    flex: 1;
                    display: flex;
                }

                .p-tab-box .p-tab .login,
                .p-tab-box .p-tab .regist {
                    width: 40%;
                }


                .popCont {
                    padding: 0px;
                    /* 增加内边距 */
                    width: 100%;
                    height: 80%;
                    /* margin: 0 auto; */
                }

                /* .p-tab {
                    display: flex;
                    flex-direction: column;
                    /* 将选项卡改为垂直排列 */
            }

            .p-tab a {
                margin-bottom: 5px;
                font-size: 16px !important;
                /* 调整选项卡之间的间距 */
            }

            .p-dl {
                margin-bottom: 30px;
                /* 调整表单之间的间距 */
            }

            .login-items li {
                margin-bottom: 10px;
                /* 调整表单项之间的间距 */
            }

            .hot-phone {
                float: left;
            }

            .p-tab {
                border-bottom: #fff;
            }

            .popCont {
                width: 100%;

                /* width: 100%; */
            }

            .login-items {
                padding-top: 80px;
            }

            .clearfix {
                padding-top: 60px;
            }
        }
    </style>
    <!--<div class="copyrights" id="links20210126">-->
    <!--    Collect from <a href="http://www.cssmoban.com/" title="网站模板">模板之家</a>-->
    <!--    <a href="http://cooco.net.cn/" title="组卷网">组卷网</a>-->
    <!--</div>-->

    <script type="text/javascript" src="script/3c-menu.js"></script>

    <script type="text/javascript" src="script/index.js"></script>
    <script type="text/javascript" src="script/address.js"></script>
    <script type="text/javascript" src="script/lg_reg.js"></script>
    <script src="script/swiper-bundle.min.js"></script>

    <!--导航登陆网页版下拉-->
    <script type="text/javascript">
        $(function () {
            var setTime;
            $(".egc-top .nav-cent .operate").hover(function () {
                var _this = $(this);
                setTime = setTimeout(function () {
                    _this.find(".sec-version").slideDown(200);
                    _this.find("i").removeClass("icon-angle-down").addClass("icon-angle-up");
                }, 200);
            }, function () {
                if (setTime) {
                    clearTimeout(setTime);
                }
                $(".egc-top .nav-cent .sec-version").slideUp(200);
                $(".egc-top .nav-cent .operate i").removeClass("icon-angle-up").addClass("icon-angle-down");
            });
        });
    </script>

    <!--下拉导航关闭-->
    <script type="text/javascript">
        $(function () {
            $('.menu-mb i').click(function () {
                $(".navigation-mb-list").slideDown(300);
            });
            $('.navigation-mb-list .list-close-btn').click(function () {
                $(".navigation-mb-list").slideUp(300);
            });
        });
    </script>

    <script type="text/javascript">
        $(function () {
            var scroll_heitht = $('body').offset().top;
            var isShow = true;
            $(window).scroll(function () {
                if ($(window).scrollTop() > scroll_heitht && isShow) {
                    $('.stress-search-box').slideDown(200);
                } else {
                    $('.stress-search-box').slideUp(200);
                }
            });
            $('.stress-close a').click(function () {
                isShow = false;
                $('.stress-search-box').slideUp(200).unbind(window, aa);
            });
        });
    </script>
    <script type="text/javascript">
        $('.all-sort-list > .item').hover(function () {
            var eq = $('.all-sort-list >.item').index(this),				//获取当前滑过是第几个元素
                h = $('.all-sort-list').offset().top,						//获取当前下拉菜单距离窗口多少像素
                s = $(window).scrollTop(),									//获取游览器滚动了多少高度
                i = $(this).offset().top,									//当前元素滑过距离窗口多少像素
                item = $(this).children('.item-list').height(),				//下拉菜单子类内容容器的高度
                sort = $('.all-sort-list').height();						//父类分类列表容器的高度

            if (item < sort) {												//如果子类的高度小于父类的高度
                if (eq == 0) {
                    $(this).children('.item-list').css('top', (i - h));
                } else {
                    $(this).children('.item-list').css('top', (i - h));
                }
            } else {
                if (s > h) {												//判断子类的显示位置，如果滚动的高度大于所有分类列表容器的高度
                    if (i - s > 0) {											//则 继续判断当前滑过容器的位置 是否有一半超出窗口一半在窗口内显示的Bug,
                        $(this).children('.item-list').css('top', (s - h) + 2);
                    } else {
                        $(this).children('.item-list').css('top', (s - h) - (-(i - s)) + 2);
                    }
                } else {
                    $(this).children('.item-list').css('top', 0);
                }
            }

            $(this).addClass('hover');
            $(this).children('.item-list').css('display', 'block');
        }, function () {
            $(this).removeClass('hover');
            $(this).children('.item-list').css('display', 'none');
        });

        $('.item > .item-list > .close').click(function () {
            $(this).parent().parent().removeClass('hover');
            $(this).parent().hide();
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.flexslider').flexslider({
                directionNav: true,
                pauseOnAction: false
            });
            $('.flexslider').hover(function () {
                $('.flex-direction-nav').fadeIn();
            }, function () {
                $('.flex-direction-nav').fadeOut();
            })
        });

        $(function () {
            $('.navmenu li').hover(function () {
                $('span', this).stop().css('height', '2px');
                $('span', this).animate({
                    left: '0',
                    width: '100%',
                    right: '0'
                }, 200);
            }, function () {
                $('span', this).stop().animate({
                    left: '50%',
                    width: '0'
                }, 200);
            });
        });
    </script>

    <script type="text/javascript">
        $(function () {

            $("#sjld").sjld("#shenfen", "#chengshi");

        });
        $(function () {
            var t = null, $this, i = 0;
            //品牌
            $(".brand-all").bind({
                mouseenter: function () {
                    $(this).find(".otherbrand").show();
                },
                mouseleave: function () {
                    $(this).find(".otherbrand").hide();
                }
            });

        });
        $(".hoverWidget").each(function () {
            $(this).mouseenter(function () {
                $(this).addClass("active")
            }).mouseleave(function () {
                $(this).removeClass("active")
            })
        });
        var swiperFun = new Swiper(".mySwiper", {

            // spaceBetween: 30,
            // centeredSlides: true,
            loop: true, // 循环模式选项
            autoplay: true,
            pagination: {
                el: ".swiper-pagination",
                clickable: true
            },
            navigation: {
                nextEl: ".swiper-button-next",
                prevEl: ".swiper-button-prev"
            },
            // on: {
            //     autoplayTimeLeft(s, time, progress) {
            //         // progressCircle.style.setProperty("--progress", 1 - progress);
            //         // progressContent.textContent = `${Math.ceil(time / 1000)}s`;
            //     }
            // }
        });
        $(document).ready(function () {

            $("#leftsead a").hover(function () {
                if ($(this).prop("className") == "youhui") {
                    $(this).children("img.hides").show();
                } else {
                    $(this).children("img.hides").show();
                    $(this).children("img.shows").hide();
                    $(this).children("img.hides").animate({ marginRight: '0px' }, 'slow');
                }
            }, function () {
                if ($(this).prop("className") == "youhui") {
                    $(this).children("img.hides").hide('slow');
                } else {
                    $(this).children("img.hides").animate({ marginRight: '-143px' }, 'slow', function () {
                        $(this).hide();
                        $(this).next("img.shows").show();
                    });
                }
            });

            $("#top_btn").click(function () {
                if (scroll == "off") return;
                $("html,body").animate({ scrollTop: 0 }, 600);
            });

        });
    </script>

    <script type="text/javascript">
        new Vue({
            el: "#index",
            data: {
                img: "",
                imgCodePrefix: "data:image/jpeg;base64,",
                RegisterDTO: {
                    username: "",
                    password: "",
                    confirmPassword: "",
                    phone: "",
                    email: "",
                    // imageCode: "",
                    // smsCode: "" // 手机验证码
                },

                //用户名登录data
                loginDto: {
                    username: '',
                    password: ''
                },

                //用来登录后展示用户名
                username: "",
                userid: "",
                user: {
                    balance: "",
                },
                //手机号登录data
                phoneLoginIn: {
                    phone: "",
                    username: '',
                    password: '',
                    smsCode: "",
                    type: 1
                },

                //找回密码data
                retrievePassword: {
                    phone: "",
                    username: "",
                    smsCode: "",
                    password: "",
                    confirmPassword: "",
                    type: 1
                },
                lunbopic: [],

            },

            methods: {
                getlunboPic() {
                    this.$http.get("/poster/getluobopic")
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                this.lunbopic = result.resultObj;
                                console.log("===========")
                                console.log(this.lunbopic)
                            }
                        }).catch(result => {

                        })
                },
                recharge() {
                    alert("请联系QQ:3688032004;QQ:2717196271")
                },
                getuserBalace() {
                    if (this.userid != null) {
                        this.$http.get("/user/" + this.userid)
                            .then(result => {
                                result = result.data;
                                if (result.success) {
                                    this.user = result.resultObj;
                                    // console.log("5555555555555555==============")
                                    // console.log(this.user)
                                } else {

                                }
                            }).catch(result => {

                            })
                    }
                },

                //修改密码提交
                changePasswordCommit() {
                    this.retrievePassword.username = this.retrievePassword.phone;
                    if (!this.retrievePassword.phone) {
                        alert("手机号码不能为空");
                        return;
                    }
                    if (!this.retrievePassword.smsCode) {
                        alert("手机验证码不能为空");
                        return;
                    }
                    //比较两次密码是否一致
                    if (this.retrievePassword.password != this.retrievePassword.confirmPassword) {
                        alert("两次密码不一致，请重新输入");
                        return;
                    }
                    this.$http.post("/login/changePassword", this.retrievePassword)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                alert("修改成功");
                                //关闭弹框
                                $("#popBox").fadeOut();
                            } else {
                                alert(result.message);
                            }
                        }).catch(result => {

                        })

                },

                //修改密码发送手机验证码
                sendPhoneMessageChangePassword(event) {
                    //参数非空
                    if (!this.retrievePassword.phone) {
                        alert("手机号不能为空");
                        return;
                    }

                    //获取按钮，禁用按钮
                    var sendBtn = $(event.target);
                    sendBtn.attr("disabled", true);

                    //发送ajax请求
                    this.$http.post("/verification/sms/changePassword", this.retrievePassword)
                        .then(result => {
                            var ajaxResult = result.data;
                            if (ajaxResult.success) {
                                alert("手机验证码已经发送到您的手机，请在5分钟内使用");
                                //4.1.发送成：倒计时
                                var time = 60;

                                var interval = window.setInterval(function () {
                                    //每一条倒计时减一
                                    time = time - 1;

                                    //把倒计时时间搞到按钮上
                                    sendBtn.val(time + "秒后重发");

                                    //4.2.倒计时完成恢复按钮
                                    if (time <= 0) {
                                        sendBtn.val("重新发送");
                                        sendBtn.attr("disabled", false);
                                        //清除定时器
                                        window.clearInterval(interval);
                                    }
                                }, 1000);
                            } else {
                                //4.3.发送失败：提示，恢复按钮
                                sendBtn.attr("disabled", false);
                                alert("发送失败:" + ajaxResult.message);
                            }
                        })
                },

                //手机号登录
                phoneLogin() {
                    this.phoneLoginIn.username = this.phoneLoginIn.phone;
                    //参数非空
                    if (!this.phoneLoginIn.username) {
                        alert("手机号不能为空");
                        return;
                    }
                    if (!this.phoneLoginIn.smsCode) {
                        alert("手机号不能为空");
                        return;
                    }
                    this.$http.post("/login/phone", this.phoneLoginIn)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                alert("登录成功，欢迎使用");
                                //将信息存到localStorage
                                localStorage.setItem("token", result.resultObj.token);
                                localStorage.setItem("loginUser", JSON.stringify(result.resultObj.loginUser));
                                //登录后需要展示用户的用户名
                                this.username = result.resultObj.loginUser.username;
                                this.balance = result.resultObj.loginUser.balance;
                                //展示登出按钮
                                $("#loginBefore").hide();
                                $("#loginAfter").show();
                                //关闭弹框
                                $("#popBox").fadeOut();
                            } else {

                            }
                        }).catch(result => {

                        })
                },

                //手机账号登录，发送手机验证码
                sendPhoneMessage(event) {
                    //参数非空
                    if (!this.phoneLoginIn.phone) {
                        alert("手机号不能为空");
                        return;
                    }
                    //获取按钮，禁用按钮
                    var sendBtn = $(event.target);
                    sendBtn.attr("disabled", true);

                    //4.发送ajax请求
                    this.$http.post("/verification/sms/phone", this.phoneLoginIn)
                        .then(result => {
                            var ajaxResult = result.data;
                            if (ajaxResult.success) {
                                alert("手机验证码已经发送到您的手机，请在5分钟内使用");
                                //4.1.发送成：倒计时
                                var time = 60;

                                var interval = window.setInterval(function () {
                                    //每一条倒计时减一
                                    time = time - 1;

                                    //把倒计时时间搞到按钮上
                                    sendBtn.val(time + "秒后重发");

                                    //4.2.倒计时完成恢复按钮
                                    if (time <= 0) {
                                        sendBtn.val("重新发送");
                                        sendBtn.attr("disabled", false);
                                        //清除定时器
                                        window.clearInterval(interval);
                                    }
                                }, 1000);
                            } else {
                                //4.3.发送失败：提示，恢复按钮
                                sendBtn.attr("disabled", false);
                                alert("发送失败:" + ajaxResult.message);
                            }
                        })
                },

                //用户登出
                loginOut() {
                    this.$http.post("/user/logout")
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                alert("登出成功");
                                localStorage.removeItem("token");
                                localStorage.removeItem("loginUser");
                                //展示登路按钮
                                $("#loginBefore").show();
                                $("#loginAfter").hide();
                                location.href = "/index.html";
                            }
                        }).catch(result => {

                        })
                },

                //用户登录
                loginIn() {
                    //参数非空校验
                    if (!this.loginDto.username) {
                        alert("用户民不能为空");
                        return;
                    }
                    if (!this.loginDto.password) {
                        alert("密码不能为空");
                        return;
                    }
                    this.$http.post("/user/login", this.loginDto)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                alert("登录成功，欢迎使用");
                                //将信息存到localStorage
                                localStorage.setItem("token", result.resultObj.token);
                                localStorage.setItem("loginUser", JSON.stringify(result.resultObj.loginUser));
                                //登录后需要展示用户的用户名
                                this.username = result.resultObj.loginUser.username;
                                this.user = result.resultObj.loginUser;
                                //展示登出按钮
                                this.getuserBalace();
                                $("#loginBefore").hide();
                                $("#loginAfter").show();
                                //关闭弹框
                                $("#popBox").fadeOut();
                            } else {
                                alert(result.message)
                            }
                        }).catch(result => {

                        })
                },

                //创建uuid随机字符串
                createUuid() {
                    var s = [];
                    var hexDigits = "0123456789abcdefghi";
                    for (var i = 0; i < 36; i++) {
                        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
                    }
                    s[14] = "4";
                    s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
                    s[8] = s[13] = s[18] = s[23] = "-";

                    var uuid = s.join("");
                    return uuid;
                },

                //获取图片验证码
                getImg() {
                    let imageCodeKey = sessionStorage.getItem("registerImageCodeKey");
                    if (!imageCodeKey || imageCodeKey === '') {
                        imageCodeKey = this.createUuid(); // 重新生成uuid
                        sessionStorage.setItem("registerImageCodeKey", imageCodeKey);
                    }
                    // 调用后端接口获取图片验证码
                    this.$http.get("/verification/image/" + imageCodeKey)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                this.img = this.imgCodePrefix + result.resultObj;
                            } else {

                            }
                        }).catch(result => {

                        })
                },

                //发送手机验证码
                RegisterDTOCode(event) {
                    //1.判断手机号不为空
                    if (!this.RegisterDTO.phone) {
                        alert("手机号不能为空");
                        return;
                    }
                    //2.判断图片验证码不为空
                    if (!this.RegisterDTO.imageCode) {
                        alert("图片验证码不能为空");
                        return;
                    }

                    //3.获取按钮，禁用按钮
                    var sendBtn = $(event.target);
                    sendBtn.attr("disabled", true);

                    //获取uuid
                    this.RegisterDTO.imageCodeKey = sessionStorage.getItem("registerImageCodeKey");

                    //4.发送ajax请求
                    this.$http.post("/verification/sms/register", this.RegisterDTO)
                        .then(result => {
                            var ajaxResult = result.data;
                            if (ajaxResult.success) {
                                alert("手机验证码已经发送到您的手机，请在5分钟内使用");
                                //4.1.发送成：倒计时
                                var time = 60;

                                var interval = window.setInterval(function () {
                                    //每一条倒计时减一
                                    time = time - 1;

                                    //把倒计时时间搞到按钮上
                                    sendBtn.val(time + "秒后重发");

                                    //4.2.倒计时完成恢复按钮
                                    if (time <= 0) {
                                        sendBtn.val("重新发送");
                                        sendBtn.attr("disabled", false);
                                        //清除定时器
                                        window.clearInterval(interval);
                                    }
                                }, 1000);
                            } else {
                                //4.3.发送失败：提示，恢复按钮
                                sendBtn.attr("disabled", false);
                                alert("发送失败:" + ajaxResult.message);
                            }
                        })
                },

                //注册方法
                registerSave() {
                    //判断手机号不能为空
                    if (!this.RegisterDTO.username) {
                        alert("用户名不能为空");
                        return;
                    }
                    //比较两次密码是否一致
                    if (this.RegisterDTO.password != this.RegisterDTO.confirmPassword) {
                        alert("两次密码不一致，请重新输入");
                        return;
                    }

                    //调用后端注册接口
                    this.$http.post("/user/register", this.RegisterDTO)
                        .then(result => {
                            result = result.data;
                            if (result.success) {
                                alert("恭喜你,注册成功!");
                                $('#popBox').fadeOut(); // 关闭注册弹框
                            } else {
                                alert(result.message);
                            }
                        })
                }
            },

            mounted() {

                //如果localStorage已经有值，此时应该是登录状态
                var loginUser = localStorage.getItem("loginUser");
                if (loginUser) {
                    loginUser = JSON.parse(loginUser);
                    this.username = loginUser.username;
                    this.userid = loginUser.id;
                    this.user = loginUser;
                    //展示登出按钮
                    $("#loginBefore").hide();
                    $("#loginAfter").show();

                }

            }

        })
    </script>
</body>


</html>